#include "Program.h"

Program::Program(std::string fileName)
{
	this->fileName = fileName;
}

void Program::Do()
{

	std::vector<Task> tabN = read();
	Algorithm alg(tabN);
	int Cmax=alg.Calier();
	std::cout<<Cmax<<std::endl;

}
std::vector<Task> Program::read()
{
	Task task;
	int size=0;
	std::vector<Task> tasks;
	std::ifstream file(this->fileName);
	
	if (file.good() == true)
	{
		file>>size;
		for(int i= 0 ;i<size;i++)
		{
			file>>task.r>>task.p>>task.q;
			task.id=i;
			tasks.push_back(task);
		}
	}
	file.close();	
	return tasks;
}